//
//  XJYLandingViewController.m
//  ShopMall
//
//  Created by XJY on 17/1/18.
//  Copyright © 2017年 XinJinYing. All rights reserved.
//

#import "XJYLandingViewController.h"
#import "XJYLandingNextViewController.h"
#import "XJYLandingInputView.h"
#import "XJYThirdLoginView.h"
@interface XJYLandingViewController ()<UITextFieldDelegate>

@property (nonatomic, strong) XJYLandingInputView *landingInputView;

@property (nonatomic, strong) XJYThirdLoginView *thirdLoginView;

@end

@implementation XJYLandingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = MainColor;
    self.edgesForExtendedLayout = 0;
    self.title = @"注册";

    [self.view addSubview:self.landingInputView];
    [self.view addSubview:self.thirdLoginView];
    
    [self setupLayout];
}

#pragma mark - 懒加载
- (XJYLandingInputView *)landingInputView
{
    if (!_landingInputView) {
        _landingInputView = [[XJYLandingInputView alloc] init];
        __weak typeof(self) weakSelf = self;
        _landingInputView.nextBlock = ^(NSDictionary *dic){
            XJYLandingNextViewController *nextVC = [[XJYLandingNextViewController alloc] init];
            nextVC.messageDic = dic;
            [weakSelf.navigationController pushViewController:nextVC animated:YES];
        };
    }
    return _landingInputView;
}

- (XJYThirdLoginView *)thirdLoginView
{
    if (!_thirdLoginView) {
        _thirdLoginView = [[XJYThirdLoginView alloc] init];
    }
    return _thirdLoginView;
}


#pragma mark - 布局
- (void)setupLayout
{
    __weak typeof(self) weakSelf = self;
    [_landingInputView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.left.top.equalTo(weakSelf.view);
        make.height.equalTo(@230);
    }];
    
    [_thirdLoginView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.landingInputView.mas_bottom);
        make.right.left.equalTo(weakSelf.view);
        make.height.equalTo(@85);
    }];
}


@end
